<!DOCTYPE html>
<html class='no-js' lang='en'>

<head>
    <meta charset='utf-8'>
    <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
    <title>湘北高中选修课报名-管理员登录系统</title>
    <meta content='lab2023' name='author'>
    <meta content='' name='description'>
    <meta content='' name='keywords'>
    <link href="/css/application-a07755f5.css" rel="stylesheet" type="text/css"/>
    <link href="/css/iconfont.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/css/jquery-ui-1.8.16.custom.css">
    <link rel="stylesheet" href="/css/ui.jqgrid.css">
    <link rel="stylesheet" href="/css/tip-yellowsimple.css">
    
    <style>
        .loginbox {
            background-color: rgba(255, 255, 255, 0.5);
        }
        
        body {
            background: url("/images/015af5707af6f2319c8ddc1a92c28b57.jpg") center top no-repeat;
            background-size: cover;
            padding: 0;
        }
        
        #tip , #tip_loginErr {
            display: none;
        }
        h1 {
            color: rgba(36, 243, 45, 0.67)
        }
    
    </style>
</head>

<body class=''>
<div class="container">
    <h1>湘北高中选修课-管理员登录系统</h1>
    <div class="row loginbox">
        <div class="col-lg-5">
            <h2>登录</h2>
            <hr>
            <form id="loginForm">
                <p>
                    账号:
                </p>
                <p>
                    <input type="text" class="form-control" id="username" name="username">
                </p>
                <!--警告框-->
                <!--<div>-->
                    <!--<div class="alert alert-danger" role="alert" id="tip">学号必须是6位数字</div>-->
                <!--</div>-->
                
                <p>
                    密码:
                </p>
                <p>
                    <input type="password" class="form-control" name="password">
                <!--</p>-->
                <!--&lt;!&ndash;警告框&ndash;&gt;-->
                <!--<div>-->
                    <!--<div class="alert alert-danger" role="alert" id="tip_loginErr"></div>-->
                <!--</div>-->
                <p>
                    <input type="button" class="btn btn-success" value="登录"  id="submitbtn">
                </p>
            </form>
        </div>
    </div>
</div>


<!-- Javascripts -->
<script src="/js/lib/jquery-1.10.min.js" type="text/javascript"></script>
<script src="/js/lib/bootstrap.min.js" type="text/javascript"></script>
<script>
  //  登录验证
var $loginForm = $('#loginForm')
var $submitbtn = $('#submitbtn')

  $submitbtn.on('click',function () {
    //  获得序列化表单数据
    var form = $loginForm.serialize()
    //  发送ajax
    $.ajax({
      type: 'POST',
      url: '/admin/login',
      data: form,
      dataType: 'json'
    }).done(function (data) {
      if (data.err) {
        //  失败
        alert(data.msg)
      } else {
        //  跳转到admin
        window.location = '/admin'
      }
    }).fail(function () {
         alert('请求失败')
    })
    
    
  })
  

</script>

</body>

</html>